STORE 0 TO CNT,CR
play=savescreen(0,0,24,79)
SELE 1
SET EXCLU OFF
use &dr&f2 inde &dr&f21
GO TOP
seek ALLTRIM(compin)
if .not. eof()
   DO WHILE left(comp_name,len(ALLTRIM(compin)))=alltrim(compin)
      CNT=CNT+1
      skip
   ENDDO
   IF CNT=0
      RETURN
   ENDIF
   DECLARE FILD[CNT]
   DECLARE KODE[CNT]
   DECLARE CNAM[CNT]
   DECLARE KOADD1[CNT]
   DECLARE KOadd2[CNT]
   DECLARE KOcity[CNT]
   DECLARE KOTEL1[CNT]
   DECLARE KOFAX[CNT]
   DECLARE KOTELEX[CNT]
   SELE 1
   GO TOP
   seek ALLTRIM(compin)
   if .not. eof()
      DO WHILE left(comp_name,len(ALLTRIM(compin)))=alltrim(compin)
*      DO WHILE left(comp_name,1)=compin
         CR=CR+1
         FILD[CR]=COMP_CODE+'   '+COMP_NAME
         KODE[CR]=COMP_CODE
         CNAM[CR]=COMP_NAME
         KOADD1[CR]=COMP_ADD1
         KOadd2[CR]=comp_add2
         KOcity[CR]=comp_city
         KOTEL1[CR]=COMP_TEL1
         KOFAX[CR]=COMP_FAX
         KOTELEX[CR]=COMP_TELEX
         SKIP
      ENDDO
   endif
   set colo to w/b
   inkey()
   set colo to w+/rb,gr+/r
   @ 13,37 clea to 23,78
   @ 13,37 to 23,78 double
   pilih=achoice(14,39,22,76,FILD)
   IF LASTKEY()=13
      DARF=FILD[PILIH]
      COCOD=KODE[PILIH]
      PATCRP=KODE[PILIH]
      CONAM=CNAM[PILIH]
      COADD1=KOADD1[PILIH]
      COadd2=KOADD2[PILIH]
      COcity=KOCITY[PILIH]
      COTEL1=KOTEL1[PILIH]
      COFAX=KOFAX[PILIH]
      COTELEX=KOTELEX[PILIH]
   else
      restscreen(0,0,24,79,play)
      set color to n/bg/w+/n
      return
   ENDIF
else
   conam=space(32)
endif
